package com.ruoyi.factorydata.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.*;

import java.util.Date;

/**
 * 生产计划对象 project_production_plan
 *
 * @author ruoyi
 * @date 2025-07-26
 */
@Getter
@Setter
@TableName(resultMap = "com.ruoyi.factorydata.mapper.ProjectProductionPlanMapper.ProjectProductionPlanResult")
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class ProjectProductionPlan extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 计划编号
     */
    @Excel(name = "计划编号")
    private String planCode;

    /**
     * 关联项目产品ID
     */
    @Excel(name = "关联项目产品ID")
    private Long projectProductId;

    /**
     * 关联项目ID
     */
    @Excel(name = "关联项目ID")
    private Long projectId;

    /**
     * 项目编码
     */
    @Excel(name = "项目编码")
    private String projectCode;

    /**
     * 产品BomId
     */
    @Excel(name = "产品BomId")
    private Long productionBomId;

    /**
     * 物料id
     */
    @Excel(name = "物料id")
    private Long materialId;

    /**
     * 产品编码
     */
    @Excel(name = "产品编码")
    private String materialCode;

    /**
     * 产品名称
     */
    @Excel(name = "产品名称")
    private String materialName;

    /**
     * 规格
     */
    @Excel(name = "规格")
    private String materialSpecification;

    /**
     * 计量单位id
     */
    @Excel(name = "计量单位id")
    private Long materialUnit;

    /**
     * 计量单位名称
     */
    @Excel(name = "计量单位名称")
    private String materialUnitName;

    /**
     * 计划数量
     */
    @Excel(name = "报工数量")
    private String plannedQuantity;

    /**
     * 报工数量
     */
    @Excel(name = "计划数量")
    private String demandQuantity;


    /**
     * 剩余数量
     */
    @Excel(name = "剩余数量")
    private String remainingQuantity;

    /**
     * 优先级(1=紧急, 2=高, 3=中, 4=低)
     */
    @Excel(name = "优先级(1=紧急, 2=高, 3=中, 4=低)")
    private String priority;

    /**
     * 计划开始时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "计划开始时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date plannedStartTime;

    /**
     * 计划结束时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "计划结束时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date plannedEndTime;

    /**
     * 实际开始时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "实际开始时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date actualStartTime;

    /**
     * 交付开始日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date deliveryStartDate;


    /**
     * 交付结束日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date deliveryEndDate;

    /**
     * 实际结束时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "实际结束时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date actualEndTime;

    private Long workshopId;

    /**
     * 批次号
     */
    private Integer batchNumber;

    /**
     * 状态
     */
    @Excel(name = "状态")
    private String status;

    /**
     * 版本号
     */
    @Version
    private Long version;

    /**
     * 删除标志（0代表存在 2代表删除）
     */
    @TableLogic(value = "0", delval = "2")
    private String delFlag;

    /**
     * 生产订单号
     */
    @TableField(exist = false)
    private String productionOrderNumber;
    /**
     * 物料分类id
     */
    @TableField(exist = false)
    private Long materialCategoryId;
    /**
     * 物料分类名称
     */
    @TableField(exist = false)
    private String materialCategoryName;
    /**
     * 物料类型
     */
    @TableField(exist = false)
    private String materialType;

    /**
     * 制造方式id
     */
    @Excel(name = "制造方式id")
    @TableField(exist = false)
    private String manufacturingMethod;

    /**
     * 车间名称
     */
    @TableField(exist = false)
    private String workShopName;

    /**
     * 客户id
     */
    @TableField(exist = false)
    private Long customerId;

    /**
     * 客户名称
     */
    @TableField(exist = false)
    private String customerName;
    /**
     * 母版编码
     */
    @TableField(exist = false)
    private String modelNumber;

    /**
     * 表征需求
     */
    @Excel(name = "表征需求")
    @TableField(exist = false)
    private String characterizationRequirement;

    /**
     * 外观需求
     */
    @Excel(name = "外观需求")
    @TableField(exist = false)
    private String surfaceRequirement;

    /**
     * 项目目标
     */
    @TableField(exist = false)
    private String target;
    /**
     * 项目附件
     */
    @TableField(exist = false)
    private String projectAttachments;
}